home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
GETFILEN.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-30
|
2KB
|
68 lines
/********************************/
/* File: GetFileNameToSave.c */
/* */
/* Using Standard File Package */
/* query the user for the name */
/* of a file to open, and return*/
/* the name along with the */
/* working directory id of the */
/* file. */
/* */
/* Paramters: */
/* requires no input parameters */
/* ---------------------------- */
/* To Build: */
/* */
/* (1) Create a project using */
/* this file as well as the */
/* XCMD.Glue.c file. (Set */
/* project type to XCMD (or */
/* XFCN) from the Project menu. */
/* */
/* (2) Bring the project up to */
/* date. */
/* */
/* (3) Build Code Resource. */
/* */
/* (4) Use ResEdit to copy the */
/* resource to your stack. */
/********************************/
#include <MacTypes.h>
#include <OSUtil.h>
#include <MemoryMgr.h>
#include <FileMgr.h>
#include <ResourceMgr.h>
#include <pascal.h>
#include <string.h>
#include "HyperXCmd.h"
#include "HyperUtils.h"
pascal void main( paramPtr )
XCmdBlockPtr paramPtr;
{
short FileWDID;
long temp;
char FileName[256];
char WDIDString[32];
char comma[2];
*FileName = '\0';
Concat( (char *)FileName, "\pUntitled" );
if( GetFileNameToSave( "", FileName, &FileWDID ) ){
temp = (long)FileWDID & 0xFFFF;
NumToStr( paramPtr, temp, &WDIDString );
PtoCstr( WDIDString );
comma[0] = ','; /* for you MPW folk */
comma[1] = '\0';
strcat( FileName, comma );
strcat( FileName, WDIDString );
CtoPstr( FileName );
}
paramPtr->returnValue = PasToZero( paramPtr, FileName );
}